﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Moon.Sql
{
    public interface IInsertable<T>
    {
        IInsertable<T> Insertable(T t);
        IInsertable<T> Insertable(List<T> list);
        /// <summary>
        /// 设置表名
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="isQuote">是否转义</param>
        /// <returns></returns>
        IInsertable<T> TableName(string tableName = null, bool isQuote = true);
        /// <summary>
        /// 忽略列
        /// </summary>
        /// <param name="columns"></param>
        /// <returns></returns>
        IInsertable<T> IgnoreColumns(Expression<Func<T, object>> columns);
        IInsertable<T> IgnoreColumns(string[] columns);
        IInsertable<T> SetColumns(Expression<Func<T, object>> columns);
        IInsertable<T> SetColumns(string[] columns);
        int BulkInsert();
        Task<int> BulkInsertAsync();
        int Execute();
        Task<int> ExecuteAsync();
        long ExecuteIdentity();
        Task<long> ExecuteIdentityAsync();
        DataTable ToDataTable();
        SqlBuilderResult ToSql();
    }
}
